import React from "react"
import SearchInput from "../../SearchInput"

export default class HotSearchHead extends React.Component{

    constructor(){
        super();
        this.state = {
            inputContent: '搜索你想要的区域'
        }
    }

    searchKeyWordFun(keyWord){
       this.props.history.push('/currentpage/'+encodeURIComponent(keyWord));
    }
    backLastPage(){
         window.history.back();
    }
    render (){
        let { inputContent } = this.state;
        return (
            <div className="home-header-container">
                <div className="home-header-left" onClick={this.backLastPage.bind(this)}>
                    <i className="iconfont icon-zuo"></i>
                </div>
                <div className="home-header-middle">
                    <SearchInput inputContent={inputContent} searchKeyWordFun={this.searchKeyWordFun.bind(this)}/>
                </div>
                <div className="home-header-right">
                    
                </div>
            </div>
        )
    }
}
